package com.qf.swagger2202.controller;

import com.qf.swagger2202.entity.User;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/test")
public class TestController {

    @ApiOperation("测试1")
    @ApiResponses({ @ApiResponse(code = 403,message = "aaaa not alowed") })
    @PostMapping("/test1")
    @ResponseBody
    public User test1( String name,
                       String password,
                       @RequestHeader("token") String token,  // 需要请求头中必须要有token这个请求头
                       @RequestBody User user){
        System.out.println(name);
        System.out.println(password);
        System.out.println(token);
        System.out.println(user);
        User use1 = new User();
        use1.setName("jack");
        use1.setPassword("123");
        return use1;
    }

}
